package com.lisp.algorithm.excercise;

public class QuickSort2 {

	// start inclusive, end inclusive; start < end
	private static int[] partition(int data[], int start, int end) {
		int lessIndex = start;
		int greaterIndex = end;
		int equalStart = -1;
		int equalEnd = -1;
		
		int x = data[start];
		while(true) {
			while(data[lessIndex] < x) {
				lessIndex++;
			}
			while(data[greaterIndex] > x) {
				greaterIndex--;
			}
			
			if(lessIndex == greaterIndex) {
				return new int[] {lessIndex, lessIndex};
			}
		}
	}
}
